1. Field of the Invention
The present invention relates to video image process, and more particularly, to a video image capturing and displaying method for a web camera.
2. Description of the Prior Art
An image transferred over a USB, which usually supports only a limited data transfer rate, can consist of as many as tens of thousands of pixels arranged in rows and columns. For example, an eight-bit gray mode picture image (one frame) captured by a web camera consists of 352×288 pixels and is around 100 Kbs in size. Image discontinuity is not perceptive to human's eyes if the image display rate is higher than 30 frames per second. However, a USB 1.1 has a data transfer rate of one Mbps and can therefore transfer only 10 frames of the eight-bit gray mode picture image per second (100 K×10=1 M). In order to prevent the image discontinuity from occurring, an image has to be properly compressed before being transferred over a USB.
Please refer to FIG. 1, which is a block diagram of an image capturing and processing system 10 according to the prior art. The system 10 comprises an image-capturing module 12, for example a web camera, for capturing a raw image f(i, j) in spatial domain at a constant rate, an image compressing module 14 for compressing the raw image f(i, j) captured by the image-capturing module 12 into a compressed image in a format consisting of a plurality of bit-streamed data, a transmission line 16 for transferring the bit-streamed data, an image-de-compressing module 18 for receiving the bit-streamed data and for de-compressing and recovering the compressed image into the raw image f(i, j), and a display 20 for displaying the recovered raw image f(i, j).
In order to ensure that the compressed image ready to be transferred over the transmission line 16 has a size smaller than 30 Kb (equal to 1 MKb divided by 30 frames), the image-compressing module has to have a variety of delicate components.
Please refer to FIG. 2, which is a block diagram of the image-compressing module 14 according to the prior art. The image-compressing module 14 comprises a discrete Cosine transform (DCT) module 22 for transforming the raw image f(i, j) into a transformed image F(u, v) in frequency domain, a quantization module 24 for quantizing the transformed image F(u, v) into a matrix-formed quantized image Fq(u, v) having low frequency coefficients disposed upper-left while high frequency coefficients disposed lower-right according to a quantization table 26 (non-uniform quantization), a difference pulse code modulation (DPCM) module 28 for generating a DC component of the quantized image Fq(u, v) by recording only the difference between the quantized image Fq(u, v) and a quantized image preceding the quantized image Fq(u, v) in a zig-zag order and decreasing the code scale of the quantized image Fq(u, v), a run length encode (RLE) module 30 for generating an AC component of the quantized image Fq(u, v) by converting consecutive identical characters of the quantized image Fq(u, v), for example consecutive zeros, into a code consisting of the character and the number making the length of the run, the longer the run, the greater the compression, an entropy coding module 32 connected to the DPCM module 28 and the RLE module 30 for generating a bit-streamed data by modeling and coding the DC and AC components of the quantized image Fq(u, v) according to a coding table 34, and a buffer 36 of a moderate size for storing the bit-streamed data ready to be transferred over the transmission line 16. The bit-streamed data comprises a variety of headers, such as a frame header comprising width/height information and horizontal/vertical sampling factors of the raw image f(i, j), and a scan header comprising number of components in a scan.
In contrast to lossless data compressors, such as Huffman, Arithmetic, and LZW used for compressing a text or a program without even a single error introduced, even a single error seriously damaging the meaning of the text or causing the program not to run, the DCT module 22, a so-called lossy data compressor, does not distort the raw image f(i, j) seriously but introduce some tolerable errors inevitably into the recovered raw image after the data-compressing and the data-decompressing processes. A trade-off therefore exists between image quality and the degree of compression, i.e. a compression ratio for lossy compression. The greater the compression ratio is, the more distorted the recovered image becomes.
Fortunately, because human's eyes are high frequency roll-off, known image compression systems remove those high frequencies from the transformed image F(u, v) by adjusting the size of quantization step of the quantization module 24. For example, for uniform quantization, the low frequency coefficients disposed on upper-left corner of the quantized image Fq(u, v) can be quantized based on a first quantization step, while the high frequency coefficients disposed on lower-right corner of the quantized image Fq(u, v) are quantized based on a second quantization step having a size larger than that of the first quantization step. Most of the high frequency coefficients are therefore have a value of zero. Alternatively, the coefficients of the quantized image Fq(u, v) can be quantized based on quantization step of a variable size by looking up a quantization table such as the quantization table 26 for non-uniform quantization.
As mentioned previously, since the USB 1.1 has the data transfer rate of only one Mbps and has to transfer more than 30 frames of image per second to overcome the image discontinuity, and the image-compressing module 14 in general does not have the capability to compress too big (abundance of information) a raw image generated by the image-capturing module 12 at the constant rate into a compressed image having to be 30 Kb or less in size, a hanging phenomenon appears on the display 20 inevitably. On the contrary, if a raw image captured by the image-capturing module 12 is plain and has a corresponding small-sized compressed image, the image-capturing module 12 captures raw images at the constant rate continuously without considering that it still has the image-compressing capability to spare.